class LogController < ApplicationController

  before_filter :verifica_administrador

  def listar
    if params[:filtro]
      @logs = Log.where("login LIKE ?", '%' + params[:filtro][:login] + '%')
                 .paginate(:page => params[:page], :per_page => 10).order('created_at DESC')
      @filtro_params = {:login => params[:filtro][:login]}
    else
      @logs = Log.paginate(:page => params[:page], :per_page => 10).order('created_at DESC')
    end
  end

end
